//
//  KeFuVC.m
//  HxgProject
//
//  Created by 黄小刚 on 2018/6/29.
//  Copyright © 2018年 XMYY-19. All rights reserved.
//

#import "ShareVC.h"
#import "RDVTabBarController.h"
#import "HTQRCodeCreater.h"
#import "Masonry.h"

#import "HxgInterfaceDefine.h"

@interface ShareVC ()

@end

@implementation ShareVC

#pragma mark - ###### Cycle Life <##>######
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"分享金橙爱花";
    
    HTQRCodeCreater *qrCreater = [[HTQRCodeCreater alloc] init];
    NSString *urlStr = [NSString stringWithFormat:@"%@%@?p=%@&type=2",iP_Address,JK_Share_iOS,[[NSUserDefaults standardUserDefaults] objectForKey:kPhoneNum]];
    UIImage *QRImage = [qrCreater createQRCodeWithUrlString:urlStr qRCodeSize:180 centerLogo:[UIImage imageNamed:@"share"] logoSize:40];
    
    UIImageView *QRView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 180, 180)];
    QRView.image = QRImage;
    [self.view addSubview:QRView];
    [QRView makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.mas_centerX);
        make.centerY.equalTo(self.view.mas_centerY).offset(- self.view.frame.size.width / 3);
        make.size.equalTo(CGSizeMake(180.0f, 180.0f));
    }];
    
    UILabel *tinLbl = [[UILabel alloc] init];
    [self.view addSubview:tinLbl];
    tinLbl.text = @"温馨提醒：请使用手机浏览器进行扫描,如果通过微信或支付宝扫描,请选择使用浏览器的方式打开链接.";
    tinLbl.numberOfLines = 0;
    tinLbl.font = cellTitleFont;
    tinLbl.textColor = [UIColor colorWithHexString:@"B2B2B2"];
    [tinLbl makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.mas_centerX);
        make.top.equalTo(QRView.mas_bottom).offset(30.0f);
        make.left.equalTo(self.view.mas_left).offset(30.0f);
        make.right.equalTo(self.view.mas_right).offset(-30.0f);
    }];
    
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [[self rdv_tabBarController] setTabBarHidden:YES animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [[self rdv_tabBarController] setTabBarHidden:NO animated:YES];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - ######  <##>######


@end
